package com.gimi.cloud.bbp.app.consumer.feign.hystrix;

import com.gimi.cloud.bbp.app.consumer.feign.UserInfoFeignService;
import com.gimi.cloud.bbp.common.enums.ResponseCodeEnum;
import com.gimi.cloud.bbp.common.utils.JsonUtil;
import com.gimi.cloud.bbp.common.utils.reqhead.Response;
import com.gimi.cloud.bbp.dto.bank.BankDTO;
import com.gimi.cloud.bbp.dto.base.BaseAppDTO;
import com.gimi.cloud.bbp.dto.userInfo.PhotoFileUploadDTO;
import com.gimi.cloud.bbp.dto.userInfo.RdExpressInfoDTO;
import com.gimi.cloud.bbp.dto.userInfo.RdUserInfoDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.util.MultiValueMap;

import java.util.Map;

/**
 * userInfo熔断
 * @author chendi
 * @date 2017年12月28日
 */
@Component
public class UserInfoHystrix implements UserInfoFeignService {
    private static Logger logger = LoggerFactory.getLogger(UserInfoHystrix.class);

	@Override
	public String addUserInfo(RdUserInfoDTO dtO) {
		logger.error("===>熔断返回");
        Response resp = new Response();
        resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
        return JsonUtil.toJson(resp);
	}

	@Override
	public String getUserInfoSingle(RdUserInfoDTO dtoparam) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String updateUserInfo(RdUserInfoDTO dto) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String photoFileUpload(PhotoFileUploadDTO part) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String updateAppUserIdinfo(Map<String, String> responseDataMap) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String addExpressInfo(RdExpressInfoDTO dtO) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String getExpressInfoSingle(RdExpressInfoDTO dtO) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String updateExpressInfo(RdExpressInfoDTO dtO) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String expressPageListByUser(RdExpressInfoDTO dtO) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String uploadCardPhoto(MultiValueMap multipartFiles) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String getUserInfo(RdUserInfoDTO dto) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String updateUserbankcard(BankDTO bankDTO) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String bankCardSign(BankDTO bankDTO) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String getUserBankcard(RdUserInfoDTO dto) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String expressDelete(RdExpressInfoDTO parseObject) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String updateUnimportantUserinfo(RdUserInfoDTO userInfo) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}

	@Override
	public String getAgreement(BaseAppDTO dto) {
		logger.error("===>熔断返回");
		Response resp = new Response();
		resp.setResponseCode(ResponseCodeEnum.EXCEED_THE_LOAD);
		return JsonUtil.toJson(resp);
	}
}
